In computer graphics, rendering is the process of producing images on a display device from descriptions of graphical objects or models. A graphics processing unit (GPU) renders 2D and 3D graphical objects, which are often represented by a combination of primitives such as points, lines, polygons, and higher order surfaces, into picture elements (pixels). A GPU typically includes a rendering pipeline for performing rendering operations. A rendering pipeline includes the following main stages: (1) vertex processing, which processes and transforms the vertices that describe the primitives, into a projection space, (2) rasterization, which converts each primitive into a set of pixels aligned with the pixel grid of the display, (3) fragment processing, which processes each individual pixel to generate its color and depth values, among other things, and (4) output processing, which combines all of the pixels into a surface (i.e., an image layer) in the 2D display space.
A displayed image (i.e., a frame) is typically composed of multiple surfaces, and each surface is composed of pixels. Each pixel is described by a number of values and attributes including but not limited to: a pixel position, a depth value, and a color value such as a four-tuple vector (R, G, B, A) indicating the values of red, green, blue, and an alpha value specifying a degree of transparency of the pixel. The alpha value is typically normalized to the range of [0, 1], with 0 denotes fully transparent and 1 denotes fully opaque. A fully-transparent surface consists of fully-transparent pixels only, and a fully-opaque surface consists of fully-opaque pixels only. A fully-transparent surface has no contribution to the displayed frame; that is, the color values of the surface are completely nullified by the zero alpha values of its pixels. On the other hand, a fully-opaque surface completely blocks any overlapping portions of the surfaces (if any) behind it.
Some of the existing graphics systems read the color values of every surface when multiple surfaces are composited into a frame, even if the alpha values of these surfaces indicate that some of the color values are not needed. Reading the color values involves memory access and causes delays. As the display generally operates at a fixed refreshing frequency (e.g., 60 Hz), the delays may cause dropped frames and poor system performance.
To reduce memory access, a compositor may determine whether or not to retrieve a surface, or a portion thereof, based on the contents of a hint buffer. If the buffer indicates that the surface is fully transparent, then the compositor does not even fetch the surface. If the buffer indicates that the surface is fully opaque, then the compositor does not fetch those surfaces or the overlapping portions of those surfaces (if any) that are behind the fully-opaque surface.
However, the generation of the hint buffer content adds significant overhead to the system performance. Therefore, there is a need to improve the generation of the hint buffer content.